﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml;
using FireStarterModeller.BO;
using FireStarterModeller.Logic;
using NUnit.Framework;

namespace FireStarterModeller.Test.Logic
{
    [TestFixture]
    public class TestDMToEntityClassDefsXmlConverter
    {
        [TestFixtureSetUp]
        public void SetupFixture()
        {
            TestUtilsLogic.SetupFixture();
        }

        [SetUp]
        public void SetupTest()
        {
            TestUtilsLogic.SetupTest();
        }

        [Test]
        public void TestXmlIsWellFormed()
        {
            //---------------Set up test pack-------------------
            DMClass dmClass = TestUtilsLogic.CreateClassWithOneGuidProperty();

            //---------------Assert PreConditions---------------            
            //---------------Execute Test ----------------------
            DMToEntityClassDefsXmlConverter converter = new DMToEntityClassDefsXmlConverter();
            string xml = converter.ConvertToXml((DMSolution) dmClass.Solution);

            //---------------Test Result -----------------------
            XmlDocument doc = new XmlDocument();
            doc.Load(new StringReader(xml));
            //---------------Tear Down -------------------------          
        }
    }
}
